package com.example.housingRentalSystem.mapper;

import com.example.housingRentalSystem.bean.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author 王硕
 * @version jdk21
 * @className OrderMapper
 * @description
 * @date 2025/3/22 17:40
 */
@Mapper
public interface OrderMapper {

    int insert(Order order);

    int updateStatus(@Param("id") Integer id, @Param("status") int status);

    int updateCancelInfo(@Param("id") Integer id,
                         @Param("status") int status,
                         @Param("reason") String reason);

    int refusalReason(@Param("id") Integer id,
                      @Param("refusalReason") String refusalReason,
                         @Param("status") int status)
                         ;

    Order selectById(Integer id);

    List<Order> searchOrders(@Param("customerId") Integer customerId,
                             @Param("ownerId") Integer ownerId,
                             @Param("houseId") Integer houseId,
                             @Param("status") Integer status);

    //根据id查订单
    Order getOrderById(Integer id);

}
